<?php

namespace App\Models;

use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class FreightArea
 * @package App\Models
 * @version May 8, 2018, 5:19 pm CST
 *
 * @property string first_number
 * @property string first_price
 * @property string continue_number
 * @property string continue_price
 * @property integer shop_id
 * @property integer status
 */
class FreightArea extends Model
{
    use SoftDeletes;

    public $table = 'freight_areas';
    

    protected $dates = ['deleted_at'];


    public $fillable = [
        'freight_id',
        'first_number',
        'first_price',
        'continue_number',
        'continue_price',
        'shop_id',
        'status'
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'first_number' => 'string',
        'first_price' => 'string',
        'continue_number' => 'string',
        'continue_price' => 'string',
        'shop_id' => 'integer',
        'status' => 'integer'
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        
    ];

    public function provinces()
    {
        return $this->belongsToMany('App\Models\Province','freight_area_province');
    }
}
